#ifndef __CLOUD_TASK_H
#define __CLOUD_TASK_H
#include <rtthread.h>
#include "paho_mqtt.h"

enum cloud_task_status{
    cloud_init_status,
    cloud_online_status,
    cloud_offline_status,
    cloud_work_status,

};
void cloud_task_init(void);
int mqtt_subscribe(MQTTClient* client,char* tpoic);
int mqtt_publish(const rt_uint8_t *topic, const rt_uint8_t *data, rt_uint32_t len,rt_uint8_t qos);

static void mqtt_sub_callback(MQTTClient *c, MessageData *msg_data);
static void mqtt_connect_callback(MQTTClient *c);
static void mqtt_online_callback(MQTTClient *c);
static void mqtt_offline_callback(MQTTClient *c);
static void mqtt_sub_default_callback(MQTTClient *c, MessageData *msg_data);

//云端逻辑
int on_cloud_msg(const rt_uint8_t *topic, const rt_uint8_t *data, rt_uint32_t len);
#endif
